This section provides an example of creating a derived media handler component. The functional interface that your derived media handler component must support is described in "Derived Media Handler Components Reference," .
Before reading this section, you should be familiar with how to create components. See the chapter "Component Manager" in Inside Macintosh: More Macintosh Toolbox for a complete discussion of components--how to use them and how to create them.
Apple has defined a component type value for media handler components. All components of this type have the same type value. You can use the following constant to specify this component type:
#define MediaHandlerType 'mhlr' /* media handler */
Apple has defined a functional interface for derived media handler components. For information about the functions that your component must support, see "Derived Media Handler Components Reference," . You can use the following constants to refer to the request codes for each of the functions that your component must support:
enum {
kMediaInitializeSelect = 0x501, /* MediaInitialize */
kMediaSetHandlerCapabilitiesSelect = 0x502,
/* MediaSetHandlerCapabilities */
kMediaIdleSelect = 0x503, /* MediaIdle */
kMediaGetMediaInfoSelect = 0x504, /* MediaGetMediaInfo */
kMediaPutMediaInfoSelect = 0x505, /* MediaPutMediaInfo */
kMediaSetActiveSelect = 0x506, /* MediaSetActive */
kMediaSetRateSelect = 0x507, /* MediaSetRate */
kMediaGGetStatusSelect = 0x508, /* MediaGGetStatus */
kMediaTrackEditedSelect = 0x509, /* MediaTrackEdited */
kMediaSetMediaTimeScaleSelect = 0x50A, /* MediaSetMediaTimeScale */
kMediaSetMovieTimeScaleSelect = 0x50B, /* MediaSetMovieTimeScale */
kMediaSetGWorldSelect = 0x50C, /* MediaSetGWorld */
kMediaSetDimensionsSelect = 0x50D, /* MediaSetDimensions */
kMediaSetClipSelect = 0x50E, /* MediaSetClip */
kMediaSetMatrixSelect = 0x50F, /* MediaSetMatrix */
kMediaGetTrackOpaqueSelect = 0x510, /* MediaGetTrackOpaque */
kMediaSetGraphicsModeSelect = 0x511, /* MediaSetGraphicsMode */
kMediaGetGraphicsModeSelect = 0x512, /* MediaGetGraphicsMode */
kMediaGSetVolumeSelect = 0x513, /* MediaGSetVolume */
kMediaSetSoundBalanceSelect = 0x514, /* MediaSetSoundBalance */
kMediaGetSoundBalanceSelect = 0x515, /* MediaGetSoundBalance */
kMediaGetNextBoundsChangeSelect = 0x516,
/* MediaGetNextBoundsChange */
kMediaGetSrcRgnSelect = 0x517, /* MediaGetSrcRgn */
kMediaPrerollSelect = 0x518, /* MediaPreroll */
kMediaSampleDescriptionChangedSelect = 0x519,
/* MediaSampleDescriptionChanged */
kMediaHasCharacteristicSelect = 0x51A /* MediaHasCharacteristic */
};